
catid_array=[]
open("category2.txt") { |f|

f.each{|line| catid_array << line }}

catid_array.each do |x|
catid_array.delete(x) if x =="\n"
catid_array.delete(x) if x ==" \n"
end

catid_array.each do |x|
x.gsub!("\n","")
x.gsub!("\"","")
x.gsub!("\"","")
end

ID_cat_array =[]

catid_array.each do |x|
  cat_ID = Regexp.compile(/\d+/).match(x).to_s
  cat = Regexp.compile(/,\D+,/).match(x).to_s.gsub!(",","")
  cat_name = Regexp.compile(/,\D+/).match(x).to_s.gsub!(",","")
  cat_name = cat_name.gsub!(/\w+/,"")
  array =[]
  array << cat_ID << cat << cat_name
  ID_cat_array << array
end


line_array=[]

open('google_keywords_insert1118.sql') { |f|

f.each{|line| 


line_array << line

}}

line_array.each do |x|
line_array.delete(x) if x =="\n"
line_array.delete(x) if x ==" \n"

end

line_array.each do |x|
x.gsub!("\n","")
x.gsub!("\"","")
x.gsub!("\"","")
end
line_array.uniq!
 line_array.each do |x|
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 open(?,'a')do |f|
      f.puts "#{keyword[0]}"
      end
 end 